<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="peoit" tagdir="/WEB-INF/tags" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<peoit:include>
	<div class="pd-20">
		<form action="<c:url value="/admin/banner/add"/>" method="post" class="form form-horizontal" id="form-banner-add">



			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>标题：</label>
				<div class="formControls col-7">
					<input type="text" class="input-text" placeholder="标题" id="user-name" name="title" datatype="*"   nullmsg="标题不能为空">
				</div>
				<%--<div class="col-4" style="color: red;">必须是英文字母加者下划线</div>--%>
			</div>

			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>类型：</label>
				<div class="formControls col-5 ">
					<div class="radio-box">
						<input type="radio" id="actType" value="act" checked name="type">
						<label for="actType">活动</label>
					</div>

					<div class="radio-box">
						<input type="radio" id="proType" value="pro" name="type" datatype="*" nullmsg="请选择类型！">
						<label for="proType">项目</label>
					</div>

				</div>
				<div class="col-4"> </div>
			</div>

			<div class="row cl" id="proNum" style="display: none">
				<label class="form-label col-3"><span class="c-red">*</span>项目编号：</label>
				<div class="formControls col-7">
					<input type="text" class="input-text" placeholder="项目编号" name="proNum"    nullmsg="项目编号不能为空">
				</div>
			</div>


			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>选择城市：</label>
				<div class="formControls col-7">
						<select name="city" class="select" datatype="*"  nullmsg="请选择选择城市">
							<option value="" selected>选择城市</option>
							<option value="北京">北京</option>
							<option value="上海">上海</option>
							<option value="天津">天津</option>
							<option value="重庆">重庆</option>
							<option value="安徽">安徽</option>
							<option value="福建">福建</option>
							<option value="甘肃">甘肃</option>
							<option value="广东">广东</option>
							<option value="贵州">贵州</option>
							<option value="河北">河北</option>
							<option value="黑龙江">黑龙江</option>
							<option value="河南">河南</option>
							<option value="湖北">湖北</option>
							<option value="湖南">湖南</option>
							<option value="吉林">吉林</option>
							<option value="江西">江西</option>
							<option value="江苏">江苏</option>
							<option value="辽宁">辽宁</option>
							<option value="辽宁">山东</option>
							<option value="陕西">陕西</option>
							<option value="山西">山西</option>
							<option value="四川">四川</option>
							<option value="云南">云南</option>
							<option value="浙江">浙江</option>
							<option value="青海">青海</option>
							<option value="广西">广西</option>
							<option value="内蒙古">内蒙古</option>
							<option value="宁夏">宁夏</option>
							<option value="西藏">西藏</option>
							<option value="新疆">新疆</option>
							<option value="中国香港">中国香港</option>
							<option value="中国台湾">中国台湾</option>
							<option value="中国澳门">中国澳门</option>
						</select>

				</div>
				<div class="col-4"> </div>
			</div>

			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>URL：</label>
				<div class="formControls col-7">
					<input type="text" placeholder="请输入URL" name="url" datatype="*" autocomplete="off"  class="input-text" >
				</div>
				<div class="col-4"> </div>
			</div>

			<div class="row cl">
				<label class="form-label col-3">描述：</label>
				<div class="formControls col-7">
					<input type="text" placeholder="请输入描述" name="description" autocomplete="off"  class="input-text" >
				</div>
				<div class="col-4"> </div>
			</div>


			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>项目图片：</label>
				<div class="formControls col-7">
					<div class="fileupload fileupload-new" data-provides="fileupload">
						<div class="fileupload-new thumbnail" style="width: 433px; height: 150px;">
							<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt="">
						</div>
						<div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 433px; max-height: 150px; line-height: 20px;"></div>
						<div  style="width: 433px">
                          <span class="btn btn-default btn-file">
                          <span class="fileupload-new"><i class="fa fa-paper-clip"></i><p>上传图片</p></span>
                          <span class="fileupload-exists"><i class="fa fa-undo"></i><p>重新上传</p></span>
                          <input type="file" name="bannerpic" datatype="*"  class="default">
                          </span>
							<a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload"><i class="fa fa-trash"></i><p>移除图片</p></a>
						</div>
					</div>
				</div>
			</div>

			<div class="row cl">
				<div class="col-9 col-offset-3">
					<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
				</div>
			</div>
		</form>
	</div>
 </peoit:include>
<script type="text/javascript">
	function refreshAndColse(){
		window.parent.location.href = window.parent.location;
//		var index = parent.layer.getFrameIndex(window.name);
//		parent.layer.close(index);
	}
	$(function(){
		//表单验证ajax提交
		$("#form-banner-add").Validform({
			tiptype:3,
			callback:function(form){
				$("#form-banner-add").ajaxSubFromDialog(this);
				setTimeout(refreshAndColse,1500);
				return false;
			}
		});

		$("#proType").click(function(){
			$("#proNum").show();
		}) ;

		$("#actType").click(function(){
			$("#proNum").hide();
		}) ;


		$('.skin-minimal input').iCheck({
			checkboxClass: 'icheckbox-blue',
			radioClass: 'iradio-blue',
			increaseArea: '20%'
		});
	});
</script>